using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using User.Models;
using UserSorce.Entity.Models;

namespace User.Service
{
    public class TypeServiceModels
    {

        /// <summary>
        /// 得到type的内容
        /// </summary>
        /// <param name="userData"></param>
        /// <param name="typeId"></param>
        /// <returns></returns>
        public TypesModels TurnOffTypeData(Users userData,int typeId)
        {
           foreach(var item in userData.Type)
            {
                if (item.TypeId == typeId)
                {
                    TypesModels type = new TypesModels()
                    {
                        TypeName=item.TypeName,
                        UserId=item.UserId,
                        TypeId = item.TypeId,
                        Inventory = item.Inventory,
                        Matter=item.Matter
                     };
                 return type;
                }
            }
            return null;
        }
    }
}
